package com.marchsoft.group.manager.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.marchsoft.group.manager.system.entity.Role;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ZhangHaoQi
 * @since 2020-12-20
 */
@Component
public interface RoleMapper extends BaseMapper<Role> {

    @Select("SELECT LEVEL FROM role r,USER u,user_role ur WHERE u.`username`= #{username} AND u.`username`=ur.`idcard` AND ur.`role_id`=r.`id`")
    String getAuthority(Long username);
}
